<%--
  Created by IntelliJ IDEA.
  User: 75230
  Date: 2023-4-10
  Time: 11:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入jstl--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<!-- 网页使用的语言 -->
<html lang="zh-CN">
<head>
<body>
<table border="1" align="center">
    <form action="${pageContext.request.contextPath}/admin" method="post">
        <input type="hidden" name="action" value="findUserByName" />
        <input type="text" class="form-control" id="username" name="username" placeholder="输入用户名查询">
        <input class="btn btn-primary" type="submit" value="查询" />
    </form>
</table>
<table border="1" align="center">
    <tr class="success">
        <th>编号</th>
        <th>姓名</th>
        <th>邮箱</th>
        <th>操作</th>
    </tr>
    <c:forEach var="user" items="${users}">
        <tr>
            <td>${user.id}</td>
            <td>${user.username}</td>
            <td>${user.email}</td>
            <td>
                <a class="btn btn-default btn-sm" href="/admin?action=findUserById&id=${user.id}">修改</a>&nbsp;
                <a class="btn btn-default btn-sm" href="/admin?action=deleteById&id=${user.id}" onclick="return confirm('您确认删除吗?') ">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>

</body>
</html>

